﻿/*
 * Created by SharpDevelop.
 * User: IEscarro
 * Date: 8/25/2009
 * Time: 4:55 PM
 * 
 * To change this template use Tools | Options | Coding | Edit Standard Headers.
 */

using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
using Miming.Model;

namespace Miming.Gui.Items
{
	/// <summary>
	/// Description of InventoryPartPane.
	/// </summary>
	public partial class InventoryPartPane : BaseUserControl, IObserver
	{
		public InventoryPartPane()
		{
			//
			// The InitializeComponent() call is required for Windows Forms designer support.
			//
			InitializeComponent();
			
		}
		
		protected override void OnModelChanged(EventArgs e)
		{
			base.OnModelChanged(e);
			Item i = Model as Item;
			textBoxName.Text = i.Name;
			richTextBoxDescription.Text = i.PurchaseDescription;
			textBoxCost.Text = i.Cost.ToString("0.00");
			richTextBoxSalesDescription.Text = i.SalesDescription;
			textBoxSalesPrice.Text = i.SalesPrice.ToString("0.00");
		}
		
		public void Update(Observable o)
		{
			Model = o;
		}
	}
	
	public class InventoryPartType : ItemType
	{
		public InventoryPartType() : base("Inventory Part", new InventoryPartPane(), "Use for goods you purchase, track as inventory, and resell.")
		{
		}
	}
}
